//
//  MYNewsShopDetailsHotelVC.m
//  MuYing
//
//  Created by tbb on 2020/3/5.
//  Copyright © 2020 TBB. All rights reserved.
//

#import "MYNewsShopDetailsHotelVC.h"
#import "MYNewsShopDetailsCalendar.h"
#import "MYNewsShopHotelMoreListVC.h"
#import "MYNewsShopDetailsHotelOrderVC.h"
@interface MYNewsShopDetailsHotelVC ()

@end

@implementation MYNewsShopDetailsHotelVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.section = 6;
    self.type = 0;
    [self.bottonView.buyBtn setTitle:kYQLS(@"查看更多") forState:(UIControlStateNormal)];
    [self.bottonView.buyBtn addTarget:self action:@selector(lookUpMoreAction:) forControlEvents:(UIControlEventTouchUpInside)];
//    getTomorrowDay
    
    self.data1 = [NSDate date];

    int days = 1;    // n天后的天数
    NSDate *appointDate;    // 指定日期声明
    NSTimeInterval oneDay = 24 * 60 * 60;  // 一天一共有多少秒
    appointDate = [self.data1 initWithTimeIntervalSinceNow: oneDay * days];
    self.data2 = appointDate;
    NSLog(@"");
}

-(void)lookUpMoreAction:(UIButton *)sender {
    MYNewsShopHotelMoreListVC *listVC = [MYNewsShopHotelMoreListVC new];
    listVC.detailsModel = self.detailsModel;
    listVC.standardModel = self.standarModel;
    listVC.startDate = self.data1;
    listVC.leaveDate = self.data2;
    kYQPUSH(listVC);
}

-(void)selectDateAction:(UIButton *)sender {
    ws(self);
    [MYNewsShopDetailsCalendar showCalenderViewDate1:self.data1 date2:self.data2 allowsMultipleSelection:YES selectDateBlock:^(NSDate * _Nonnull inCheckInDate, NSDate * _Nonnull leaveDate) {
        weakself.data1 = inCheckInDate;
        weakself.data2 = leaveDate;
        [weakself.listTableView reloadData];
    }];
}
-(void)hotelGoToPayVC:(MYNewsShopDetailsStandardModel *) standardModel {
    MYNewsShopDetailsHotelOrderVC *payVC = [MYNewsShopDetailsHotelOrderVC new];
    payVC.standardModel = standardModel;
    payVC.detailsModel = self.detailsModel;
    payVC.startDate = self.data1;
    payVC.leaveDate = self.data2;
    kYQPUSH(payVC);
}


@end
